package com.mark.utils;

import java.util.Random;

/**
 * Created by Choisaaaa on 2018/6/21.
 * 随机生成key值
 */
public class KeyUtil {

    //生成唯一的主键：时间+随机数
    public static synchronized String genUniqueKey(){
        Random random = new Random();
        Integer number = random.nextInt(900000)+100000;//nextInt(900000)--->[0,899999]
        return System.currentTimeMillis()+ String.valueOf(number);
    }

}
